<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class home extends Auth_Controller{

    /**
     * 后台用户主页
     */
    public function index(){
    	//统计访问次数
    	$this->load->library('date_time');
    	//获取今日之前30天数据
    	$month = $this->date_time->month();
    	
    	//统计访问次数
    	$this->load->model('sess_mdl');
    	foreach($month as $k => $v){
    		$this->db->where('timestamp >',$v['b']);
    		$this->db->where('timestamp <=' , $v['e']);
    		$a_v[] = $this->sess_mdl->get_count();
    		$a_x[] = $v['day'];
    	}
    	//查询最大值
    	$access = array(
    			'max' => max($a_v)+10,
    			'val' => json_encode($a_v),
    			'x' => json_encode($a_x)
    	);
    	
		$data = array(
				'access' => $access
		);  	
    	
        $this->_view('admin/index',$data);
    }

    /**
     * 测试 文档标号
     */
    public function test(){
        $this->_view('Home/home_text');
    }
    
}

